@@ -2372,76 +2372,93 @@ and are attached to an [=animation attachment range|attachment range=].
2372
2372
2373
2373
Issue: Should there be any effect of triggers on scroll-driven animations?
2374
2374
2375
- ### Animation Trigger Types ### {#trigger-types }
2375
+ ### Animation Trigger Internal State ### {#trigger-state }
2376
2376
2377
- The behavior an [=animation trigger=] applies to its associated [=animation=] ’s
2378
- playback is defined by its <dfn export>animation trigger type</dfn> , and
2379
- depending on its [=animation trigger state|state=] can apply one of two
2380
- distinct behavior types: [=animation trigger state/primary=] or [=animation trigger state/inverse=] .
2381
- Given an internal |did trigger| flag, the values of [=animation trigger type=]
2382
- can be one of the following:
2377
+ An [=animation trigger=] |trigger|
2378
+ has an internal boolean <dfn export>did trigger</dfn> flag, which is initially false,
2379
+ and an internal <dfn export lt="animation trigger state">state</dfn> with
2380
+ these possible values:
2383
2381
2384
- <dl>
2385
- <dt> ''animation-trigger-type/once''
2386
- <dd>
2387
- The [=animation trigger state/primary=] behavior is [=play an animation|triggering=] the associated animation.
2382
+ <dl dfn-for="animation trigger state">
2383
+ <dt> <dfn>idle</dfn>
2384
+ <dt> <dfn>primary</dfn>
2385
+ <dt> <dfn>inverse</dfn>
2386
+ </dl>
2388
2387
2389
- <dt> ''animation-trigger-type/repeat''
2390
- <dd>
2391
- The [=animation trigger state/primary=] behavior is [=play an animation|triggering=] the associated animation.
2392
- The [=animation trigger state/inverse=] behavior is resetting the associated [=animation effect=] back to
2393
- its [=animation effect/before phase=] and its associated animation’s [=animation/start time=] to zero.
2388
+ The values of [=animation trigger state|state=] and [=did trigger=] are
2389
+ updated by the [=updating animation trigger state=] procedure, described below.
2394
2390
2395
- <dt> ''animation-trigger-type/alternate''
2396
- <dd>
2397
- <dl class=switch>
2398
- : if the |did trigger| flag is false,
2399
- ::
2400
- The [=animation trigger state/primary=] behavior is [=play an animation|triggering=] the associated animation.
2391
+ Issue: Do we need a formal resolution on the spec of the idle state?
2401
2392
2402
- : Otherwise,
2403
- ::
2404
- The [=animation trigger state/primary=] behavior is [=reverse an animation|reversing=] the associated animation.
2393
+ ### Animation Trigger Behavior ### {#trigger-behaviors}
2405
2394
2406
- </dl>
2395
+ An [=animation trigger=] has an associated <dfn export>animation trigger behavior</dfn>
2396
+ which, along with [=did trigger=] and [=animation trigger state|state=] ,
2397
+ determines the [=animation trigger|trigger=] 's effect on its
2398
+ associated [=animation=] 's playback.
2407
2399
2408
- The [=animation trigger state/inverse=] behavior is [=reverse an animation|reversing=] the associated animation.
2400
+ The [=animation effect=] associated with an [=animation trigger=]
2401
+ in the [=animation trigger state/idle=] state
2402
+ remains in its [=animation effect/before phase=] and
2403
+ stays at zero [=animation/current time=] ,
2404
+ regardless of the trigger's [=did trigger=] flag or [=animation trigger state|state=] .
2405
+ Otherwise, the effect on playback is as follows for
2406
+ given values of <var ignore=''> behavior</var> :
2409
2407
2410
- <dt> ''animation-trigger-type/state''
2408
+ <dl>
2409
+ <dt> ''animation-trigger-behavior/once'' </dt>
2411
2410
<dd>
2412
- The [=animation trigger state/primary=] behavior is [=play an animation|triggering or resuming=] the associated animation.
2413
- The [=animation trigger state/inverse=] behavior is [=pause an animation|pausing=] the associated animation.
2414
- </dl>
2415
-
2416
- Issue: Need to bike-shed the name for type "state" type.
2411
+ <dl class=switch>
2412
+ : If [=animation trigger state|state=] is [=animation trigger state/primary=] ,
2413
+ :: the effect is to [=play an animation|trigger=] the associated animation.
2417
2414
2418
- Issue: Do we need a proper definition for "behavior types primary/inverse"?
2415
+ : Otherwise,
2416
+ :: the trigger has no effect.
2417
+ </dl>
2418
+ </dd>
2419
2419
2420
- ### Animation Trigger State ### {#trigger-state}
2420
+ <dt> ''animation-trigger-behavior/repeat'' </dt>
2421
+ <dd>
2422
+ <dl class=switch>
2423
+ : If [=animation trigger state|state=] is [=animation trigger state/primary=] ,
2424
+ :: the effect is to [=play an animation|trigger=] the associated animation.
2421
2425
2422
- An [=animation trigger=] |trigger| with [=animation trigger type=] |type|
2423
- and an associated [=animation=] |animation|
2424
- has an internal <dfn export lt="animation trigger state">state</dfn> which
2425
- controls the applied behavior type. This state has discrete values
2426
- which can be one of the following:
2426
+ : If [=animation trigger state|state=] is [=animation trigger state/inverse=] ,
2427
+ :: the effect is to reset the associated [=animation effect=] back to
2428
+ its [=animation effect/before phase=] and its associated [=animation=] ’s
2429
+ [=animation/start time=] to zero.
2430
+ </dl>
2431
+ </dd>
2427
2432
2428
- <dl dfn-for="animation trigger state">
2429
- <dt> <dfn>idle</dfn>
2433
+ <dt> ''animation-trigger-behavior/alternate''
2430
2434
<dd>
2431
- The [=animation effect=] associated |animation| remains in
2432
- its [=animation effect/before phase=] and stays at zero [=animation/current time=] .
2435
+ <dl class=switch>
2436
+ : If [=animation trigger state|state=] is [=animation trigger state/primary=]
2437
+ and [=did trigger=] is false,
2438
+ :: the effect is to [=play an animation|trigger=] the associated animation.
2433
2439
2434
- <dt> <dfn>primary</dfn>
2435
- <dd>
2436
- When switched to this value the [=animation trigger state/primary =] behavior type defined by |type| is applied to | animation| .
2440
+ : If [=animation trigger state|state=] is [=animation trigger state/primary=]
2441
+ and [=did trigger=] is true,
2442
+ :: the effect is to [=reverse an animation|reverse =] the associated animation.
2437
2443
2438
- <dt> <dfn>inverse</dfn>
2444
+ : If [=animation trigger state|state=] is [=animation trigger state/inverse=]
2445
+ :: the effect is to [=reverse an animation|reverse=] the associated animation.
2446
+ </dl>
2447
+ </dd>
2448
+
2449
+ <dt> ''animation-trigger-behavior/state''
2439
2450
<dd>
2440
- When switched to this value the [=animation trigger state/inverse=] behavior type defined by |type| is applied to |animation|.
2451
+ <dl class=switch>
2452
+ : If [=animation trigger state|state=] is [=animation trigger state/primary=]
2453
+ :: the effect is to [=play an animation|trigger or resume=] the associated animation.
2441
2454
2455
+ : If [=animation trigger state|state=] is [=animation trigger state/inverse=]
2456
+ :: the effect is to [=pause an animation|pause=] the associated animation.
2457
+ </dl>
2458
+ </dd>
2442
2459
</dl>
2443
2460
2444
- Issue: Do we need a formal resolution on the spec of the idle state ?
2461
+ Issue: Do we need a proper definition for "behavior types primary/inverse" ?
2445
2462
2446
2463
### Animation Trigger Active Interval ### {#trigger-active-interval}
2447
2464
@@ -2493,29 +2510,26 @@ Depending on its most recent [=animation trigger state|state=] |state|, the
2493
2510
The procedure of <dfn>setting timeline of animation trigger</dfn> |trigger|,
2494
2511
to |new timeline| which may be <code> null</code> , is as follows:
2495
2512
2496
- 1. Let |old timeline| be the current [=timeline=] of |trigger|, if any.
2513
+ 1. Let |old timeline| be the current value of |trigger|. {{AnimationTrigger/timeline}} , if any.
2497
2514
2498
2515
1. If |new timeline| is the same object as |old timeline|, abort this procedure.
2499
2516
2500
- 1. Let the [=timeline=] of |trigger| be |new timeline|.
2517
+ 1. Set |trigger|. {{AnimationTrigger/timeline}} to |new timeline|.
2501
2518
2502
- 1. Run the procedure to [=updating animation trigger state=] for |trigger|.
2519
+ 1. Run the [=updating animation trigger state=] procedure for |trigger|.
2503
2520
</div>
2504
2521
2505
2522
### Updating Animation Trigger State ### {#updating-trigger-state}
2506
2523
2507
2524
<div algorithm="updating animation trigger state">
2508
- The procedure of <dfn>updating animation trigger state</dfn> |state|
2509
- of an [=animation trigger=] |trigger|,
2510
- with a given a flag |did trigger|, and an [=animation trigger type=] |type|,
2511
- is as follows:
2525
+ The procedure of <dfn>updating animation trigger state</dfn>
2526
+ of an [=animation trigger=] |trigger| is as follows:
2512
2527
2513
- 1. Let |did trigger| be a boolean flag that is initially false .
2528
+ 1. Let |did trigger| be the current value of |trigger|'s [=did trigger=] flag .
2514
2529
2515
- 1. Let |state| be the current [=animation trigger state|state=]
2516
- of |trigger| that is initially [=animation trigger state/idle=] .
2530
+ 1. Let |behavior| be |trigger|'s associated [=animation trigger behavior=] .
2517
2531
2518
- 1. Set |state| as follows:
2532
+ 1. Set |trigger|. [=animation trigger state|state=] as follows:
2519
2533
<dl class=switch>
2520
2534
: If |trigger|’s [=local time=] is [=unresolved=] ,
2521
2535
::
@@ -2525,7 +2539,7 @@ Depending on its most recent [=animation trigger state|state=] |state|, the
2525
2539
::
2526
2540
2527
2541
<dl class=switch>
2528
- : If |type | is ''animation-trigger-type /once'' and |did trigger| flag is true,
2542
+ : If |behavior | is ''animation-trigger-behavior /once'' and |did trigger| is true,
2529
2543
::
2530
2544
Then abort this procedure.
2531
2545
@@ -2535,16 +2549,16 @@ Depending on its most recent [=animation trigger state|state=] |state|, the
2535
2549
<dl class=switch>
2536
2550
: If |trigger| is inside its [=animation trigger/active interval|active interval=] ,
2537
2551
::
2538
- 1. Set |state| to [=animation trigger state/primary=] .
2539
- 1. Set |did trigger| to true.
2552
+ 1. Set |trigger|. [=animation trigger state|state=] to [=animation trigger state/primary=] .
2553
+ 1. Set |trigger|. [= did trigger=] to true.
2540
2554
2541
2555
: Otherwise,
2542
2556
::
2543
2557
2544
2558
<dl class=switch>
2545
- : If |did trigger| flag is true,
2559
+ : If |did trigger| is true,
2546
2560
::
2547
- Set |state| to [=animation trigger state/inverse=] .
2561
+ Set |trigger|. [=animation trigger state|state=] to [=animation trigger state/inverse=] .
2548
2562
2549
2563
</dl>
2550
2564
@@ -3609,7 +3623,7 @@ Update the type for the AnimationPlaybackEventInit members.
3609
3623
interface AnimationTrigger {
3610
3624
constructor(optional AnimationTriggerOptions options = {});
3611
3625
attribute AnimationTimeline timeline;
3612
- attribute AnimationTriggerType type ;
3626
+ attribute AnimationTriggerBehavior behavior ;
3613
3627
attribute any rangeStart;
3614
3628
attribute any rangeEnd;
3615
3629
attribute any exitRangeStart;
@@ -3624,30 +3638,24 @@ interface AnimationTrigger {
3624
3638
3625
3639
1. Create a new {{AnimationTrigger}} object, |trigger|.
3626
3640
3627
- 1. Let |type| be the {{AnimationTriggerOptions/type}} property.
3628
-
3629
- 1. Let |timeline| be the {{AnimationTriggerOptions/timeline}} property.
3641
+ 1. Set |trigger|.[=did trigger=] to false.
3630
3642
3631
- 1. Let |range start| be the {{AnimationTriggerOptions/rangeStart}} property .
3643
+ 1. Set |trigger|. [=animation trigger state|state=] to [=animation trigger state/idle=] .
3632
3644
3633
- 1. Let |range end| be the {{AnimationTriggerOptions/rangeEnd}} property .
3645
+ 1. Set |trigger|. {{AnimationTrigger/behavior}} to |options|. {{AnimationTriggerOptions/behavior}} .
3634
3646
3635
- 1. Set [=default range=] of |trigger| using |range start| and |range end| ,
3647
+ 1. Set [=default range=] of |trigger| using |options|. {{AnimationTriggerOptions/rangeStart}} and |options|. {{AnimationTriggerOptions/rangeEnd}} ,
3636
3648
following the same rules as the KeyframeAnimationOption
3637
3649
<a href="#dom-keyframeanimationoptions-rangestart">rangeStart</a> and
3638
3650
<a href="#dom-keyframeanimationoptions-rangeend">rangeEnd</a> respectively.
3639
3651
3640
- 1. Let |exit range start| be the {{AnimationTriggerOptions/exitRangeStart}} property.
3641
-
3642
- 1. Let |exit range end| be the {{AnimationTriggerOptions/exitRangeEnd}} property.
3643
-
3644
- 1. Set [=exit range=] of |trigger| using |exit range start| and |exit range end|,
3652
+ 1. Set [=exit range=] of |trigger| using |options|.{{AnimationTriggerOptions/exitRangeStart}} and |options|.{{AnimationTriggerOptions/exitRangeEnd}} ,
3645
3653
following the same rules above for [=default range=] , unless they are set to
3646
3654
"auto", in which case they are set to their corresponding side
3647
3655
of the [=default range=] .
3648
3656
3649
3657
1. Run the procedure for [=setting timeline of animation trigger=]
3650
- on |trigger| passing |timeline| as the <var ignore> new timeline</var> .
3658
+ on |trigger| passing |options|. {{AnimationTriggerOptions/timeline}} as the <var ignore> new timeline</var> .
3651
3659
3652
3660
<div dfn-type=argument class=parameters
3653
3661
dfn-for="AnimationTrigger/AnimationTrigger(options)">
@@ -3667,9 +3675,9 @@ interface AnimationTrigger {
3667
3675
Returns the [=timeline=] for this trigger
3668
3676
or `null` if this timeline is [=inactive timeline|inactive=] .
3669
3677
3670
- : <dfn>type </dfn>
3678
+ : <dfn>behavior </dfn>
3671
3679
::
3672
- Returns the [=animation trigger type|type =] of this trigger.
3680
+ Returns the [=animation trigger behavior|behavior =] of this trigger.
3673
3681
3674
3682
: <dfn>rangeStart</dfn>
3675
3683
::
@@ -3694,7 +3702,7 @@ interface AnimationTrigger {
3694
3702
<pre class='idl'>
3695
3703
dictionary AnimationTriggerOptions {
3696
3704
AnimationTimeline? timeline;
3697
- AnimationTriggerType? type = "once";
3705
+ AnimationTriggerBehavior? behavior = "once";
3698
3706
(TimelineRangeOffset or CSSNumericValue or CSSKeywordValue or DOMString) rangeStart = "normal";
3699
3707
(TimelineRangeOffset or CSSNumericValue or CSSKeywordValue or DOMString) rangeEnd = "normal";
3700
3708
(TimelineRangeOffset or CSSNumericValue or CSSKeywordValue or DOMString) exitRangeStart = "auto";
@@ -3710,10 +3718,10 @@ dictionary AnimationTriggerOptions {
3710
3718
The timeline to which the trigger is associated.
3711
3719
If not specified, the trigger is associated with [=default document timeline=] .
3712
3720
3713
- : <dfn>type </dfn>
3721
+ : <dfn>behavior </dfn>
3714
3722
::
3715
- The type of trigger to create .
3716
- If not specified, the trigger is of type ''animation-trigger-type/once'' .
3723
+ The behavior of the trigger .
3724
+ If not specified, the trigger's behavior is ''animation-trigger-type/once'' .
3717
3725
3718
3726
: <dfn>rangeStart</dfn>
3719
3727
::
@@ -3737,30 +3745,30 @@ dictionary AnimationTriggerOptions {
3737
3745
3738
3746
</div>
3739
3747
3740
- <h3 id="the-animationtriggertype -enumeration">The <code>AnimationTriggerType </code> enumeration</h3>
3748
+ <h3 id="the-animationtriggerbehavior -enumeration">The <code>AnimationTriggerBehavior </code> enumeration</h3>
3741
3749
3742
3750
<pre class='idl'>
3743
- enum AnimationTriggerType { "once", "repeat", "alternate", "state" };
3751
+ enum AnimationTriggerBehavior { "once", "repeat", "alternate", "state" };
3744
3752
</pre>
3745
3753
3746
3754
<dl dfn-type=enum-value
3747
- dfn-for="AnimationTriggerType ">
3755
+ dfn-for="AnimationTriggerBehavior ">
3748
3756
3749
3757
: <dfn>once</dfn>
3750
3758
::
3751
- Type ''animation-trigger-type /once'' .
3759
+ ''animation-trigger-behavior /once'' .
3752
3760
3753
3761
: <dfn>repeat</dfn>
3754
3762
::
3755
- Type ''animation-trigger-type /repeat'' .
3763
+ ''animation-trigger-behavior /repeat'' .
3756
3764
3757
3765
: <dfn>alternate</dfn>
3758
3766
::
3759
- Type ''animation-trigger-type /alternate'' .
3767
+ ''animation-trigger-behavior /alternate'' .
3760
3768
3761
3769
: <dfn>state</dfn>
3762
3770
::
3763
- Type ''animation-trigger-type /state'' .
3771
+ ''animation-trigger-behavior /state'' .
3764
3772
3765
3773
</dl>
3766
3774
0 commit comments